n = 1
amax = 0
count = 1 
while n:
    n = eval(input())
    if n==0:
        break
    if n > amax:
        amax = n
        count-=1
    if n==amax:
        count+=1
print(amax)
print(count)